import { configureStore } from '@reduxjs/toolkit'
// 子模块
import userReducer from './modules/user'
import { type UserInfoState } from './modules/user'
import menuReducer from './modules/menu'
import { type MenuState } from './modules/menu'
import loadingReducer from './modules/loading'
import { type LoadingState } from './modules/loading'

export type RootState = {
    user: UserInfoState,
    menu: MenuState,
    loading: LoadingState
}

// 生成store
const store = configureStore({
    reducer: {
        user: userReducer,
        menu: menuReducer,
        loading: loadingReducer
    },
})

export default store